package com.young.ysepay.controllers;

import com.young.ysepay.service.YsWeChatPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @Author Vincentxin
 * @Date 2019-05-29
 */
@RestController
@RequestMapping("/ysWeChatPay")
public class YsWeChatPayController {
    @Autowired
    private YsWeChatPayService ysWeChatPayService;

    /**
     * 银盛微信支付
     * @param paramMap
     * @return
     */
    @PostMapping("/miniAppPay")
    public Map<String,Object> miniAppPay(@RequestParam Map<String,String> paramMap){
        return ysWeChatPayService.miniAppPerPay(paramMap);
    }
    /**
     * @Author zhaopengjun
     * @Description 银盛支付异步回执
     * @Date 16:56 2019/5/21
     * @Param
     * @return
     **/
    @PostMapping("/callBack")
    public void callBack(@RequestParam Map<String,String> paramMap, HttpServletResponse response) {
         ysWeChatPayService.weChatPayCallBack(paramMap,response);


    }

}
